<%-- 
    Document   : index
    Created on : May 2, 2011, 9:04:56 PM
    Author     : Dmitry
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type='text/javascript' src='/DWRExample01/dwr/engine.js'></script>
        <script type='text/javascript' src='/DWRExample01/dwr/util.js'></script>
        
        <script type='text/javascript' src='/DWRExample01/dwr/interface/GroupService.js'></script>
        <script type='text/javascript' src='/DWRExample01/dwr/interface/ProductService.js'></script>
        
        <script type="text/javascript" src="/DWRExample01/main.js"></script>

        <title>DWR Example01</title>
    </head>
    <body>
        <div>
            <span><a href="#" onclick="showProducts();">Products</a></span>&nbsp;||&nbsp;<span><a href="#" onclick="showGroups();">Groups</a></span>
        </div>
        <div id="productsDiv" style="display: none;">
            <table>
                <thead>
                    <tr>
                        <th></th>
                        <th>ID</th>
                        <th>Name</th>
                        <th>Price</th>
                        <th>Modified</th>
                        <th>Group</th>
                    </tr>
                </thead>
                <tbody id="productTbody"> 
                </tbody>
            </table>
            <table>
                <tr><td>Product Name</td><td><input id="productNameInput" type="text" name="productName"/></td></tr>
                <tr><td>Price</td><td><input id="productPriceInput" type="text" name="productPrice"/></td></tr>
                <tr><td>Description</td><td><textarea id="productDescriptionInput" name="productDescription"></textarea></td></tr>
                <tr><td>Group</td><td><select id="productGroupSelect"></select></td></tr>
                <tr><td></td><td><button id="addProductButton" onclick="addProduct();">Add Product</button></td></tr>
            </table>
        </div>
        
        <div id="groupDiv" style="display: none;">
            
            <table>
                <thead>
                    <tr>
                        <th></th>
                        <th>ID</th>
                        <th>Name</th>
                        <th>Description</th>
                    </tr>
                </thead>
                <tbody id="groupTbody">
                </tbody>
            </table>
            <button onclick="deleteCheckedGroups();">Delete Checked</button><br/>
            <table>
                <tr><td>Group Name</td><td><input id="groupNameInput" type="text"/></td></tr>
                <tr><td>Description</td><td><textarea id="groupDescriptionInput" name="productName"></textarea></td></tr>
                <tr><td></td><td><button id="addGroupButton" onclick="addGroup();">Add Group</button></td></tr>
            </table>
        </div>   
        
        
        
        
    </body>
</html>
